package com.hhck.mapper;

import com.hhck.entity.Page;
import com.hhck.entity.Purchase;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PurchaseMapper {

    // 添加采购单（商品采购）
    int insertPurchase(Purchase purchase);

    // 查询采购单总行数（条件查询）
    int selectPurchaseCount(Purchase purchase);

    // 分页查询采购单（条件查询）
    List<Purchase> selectPurchaseListByPage(@Param("page") Page page, @Param("purchase") Purchase purchase);

    // 删除采购单
    int deletePurchaseByBuyId(Integer buyId);

    // 修改采购单
    int updatePurchaseByBuyId(Purchase purchase);

    // 根据采购单id修改采购单为已入库状态
    int updatePurchaseIsInByBuyId(Purchase purchase);

}

